<template>
  <div>
    <van-nav-bar
      title="核酸消息通知"
      left-text="返回"
      left-arrow
      @click-left="onClickLeft"
    />
    <span class="wenzi">社区居民必读！</span>
    <p style="text-align: center">
      本社区实行"五天一检常态化核酸检测",逾期未检测安康码将被赋予黄码！
    </p>
    <van-swipe-cell v-for="item in numberlist" :key="item.id">
      <van-notice-bar scrollable :text="item.content" />
      <div class="divHeight"></div>
    </van-swipe-cell>
  </div>
</template>

<script>
import axios from "axios";
export default {
  data() {
    return {
      numberlist: [],
    };
  },
  methods: {
    onClickLeft() {
      this.$router.go(-1);
    },
  },
  created() {
    axios
      .get("/api/hesuan.php")
      .then((response) => {
        this.numberlist = response.data.data;
      })
      .catch(function (error) {
        // handle error
        console.log(error);
      });
  },
};
</script>

<style>
.wenzi {
  color: red;
  font-size: 30px;
  text-align: center;
}
.divHeight {
  width: 100%;
  height: 10px;
  background: #f5f5f5;
  position: relative;
  overflow: hidden;
}
</style>